// HTMLEditorView.h : interface of the CHTMLEditorView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_HTMLEDITORVIEW_H__6E150015_4EEC_4A12_AE5F_BB3A8D7E753D__INCLUDED_)
#define AFX_HTMLEDITORVIEW_H__6E150015_4EEC_4A12_AE5F_BB3A8D7E753D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "cHtmlEditor.h"
#include "../c_tablepicker/TablePicker.h"
#include "HTMLEditorDoc.h"

//#define Html_View_Base CHtmlEditView
#define Html_View_Base CHtmlEditor
//#define InitEditor(x,y,z)
//#define ExecSetCommand(x) 1

class CHTMLEditorView : public Html_View_Base
{
protected: // create from serialization only
	CHTMLEditorView();
	DECLARE_DYNCREATE(CHTMLEditorView)

// Attributes
public:
	CHTMLEditorDoc* GetDocument();
//	Html_View_Base* m_pEditor;
// Operations

protected:
	CTablePicker m_wndTablePicker;

	void	htm_SetDefaults();
	void    htm_UpdateUI();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CHTMLEditorView)
public:
	virtual void	OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL	PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual void	OnInitialUpdate(); // called first time after construct
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual			~CHTMLEditorView();
#ifdef _DEBUG
	virtual void	AssertValid() const;
	virtual void	Dump(CDumpContext& dc) const;
#endif

	CString  m_sPath;
protected:
	BOOL     b_SelOK;
//@	IHTMLDocument2	*m_pHTMLDoc;
	bool     m_bBold;
	bool     m_bItalic;
	bool     m_bUnderline;
	int      m_nAlign;
	bool	 m_bMarkList;
	bool     m_bNumList;
	COLORREF m_clrText;
	COLORREF m_clrBack;
	COLORREF m_clrFill;
	int      m_nSelColor;
	bool     m_nSelTable;

	bool     m_bCanCopy;
	bool     m_bCanCut;
	bool     m_bCanPaste;
	bool     m_bCanUndo;
	bool     m_bCanRedo;

// Generated message map functions
protected:
	//{{AFX_MSG(CHTMLEditorView)
	afx_msg void OnCmd_Bold();
	afx_msg void OnUpd_Bold(CCmdUI* pCmdUI);
	afx_msg void OnCmd_Italic();
	afx_msg void OnUpd_Italic(CCmdUI* pCmdUI);
	afx_msg void OnCmd_Underline();
	afx_msg void OnUpd_Underline(CCmdUI* pCmdUI);
	afx_msg void OnCmd_TextColor();
	afx_msg void OnUpd_TextColor(CCmdUI* pCmdUI);
	afx_msg void OnCmd_BackColor();
	afx_msg void OnUpd_BackColor(CCmdUI* pCmdUI);
	afx_msg void OnCmd_FillColor();
	afx_msg void OnUpd_FillColor(CCmdUI* pCmdUI);
	afx_msg void OnCmd_AlignLeft();
	afx_msg void OnUpd_AlignLeft(CCmdUI* pCmdUI);
	afx_msg void OnCmd_AlignCenter();
	afx_msg void OnUpd_AlignCenter(CCmdUI* pCmdUI);
	afx_msg void OnCmd_AlignRight();
	afx_msg void OnUpd_AlignRight(CCmdUI* pCmdUI);
	afx_msg void OnCmd_AlignJustify();
	afx_msg void OnUpd_AlignJustify(CCmdUI* pCmdUI);
	afx_msg void OnCmd_MarkList();
	afx_msg void OnUpd_MarkList(CCmdUI* pCmdUI);
	afx_msg void OnCmd_NumList();
	afx_msg void OnUpd_NumList(CCmdUI* pCmdUI);

	afx_msg void OnFileSave();
	afx_msg void OnFileSaveAs();

	afx_msg void OnCmd_InsHorzLine();
	afx_msg void OnUpd_InsHorzLine(CCmdUI* pCmdUI);
	afx_msg void OnCmd_InsHyperLink();
	afx_msg void OnUpd_InsHyperLink(CCmdUI* pCmdUI);
	afx_msg void OnCmd_InsImage();
	afx_msg void OnUpd_InsImage(CCmdUI* pCmdUI);
	afx_msg void OnCmd_InsTable();
	afx_msg void OnUpd_InsTable(CCmdUI* pCmdUI);

	afx_msg void OnCmd_EditCopy();
	afx_msg void OnUpd_EditCopy(CCmdUI* pCmdUI);
	afx_msg void OnCmd_EditCut();
	afx_msg void OnUpd_EditCut(CCmdUI* pCmdUI);
	afx_msg void OnCmd_EditPaste();
	afx_msg void OnUpd_EditPaste(CCmdUI* pCmdUI);
	afx_msg void OnCmd_EditUndo();
	afx_msg void OnUpd_EditUndo(CCmdUI* pCmdUI);
	afx_msg void OnCmd_EditRedo();
	afx_msg void OnUpd_EditRedo(CCmdUI* pCmdUI);

	afx_msg void    OnColorDropDown(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg LRESULT OnSelectedColorOk(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnSelectedColorCancel(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnSelectedTableSize(WPARAM wParam, LPARAM lParam);
	afx_msg void    OnSelChangeFontSize();
	afx_msg void    OnSelChangeFontFace();
	afx_msg void    OnSelChangeFontStyle();
	afx_msg LRESULT OnMyMessage(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnIdleUpdateCmdGUI(WPARAM wParam, LPARAM lParam);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
};

#ifndef _DEBUG  // debug version in HTMLEditorView.cpp
inline CHTMLEditorDoc* CHTMLEditorView::GetDocument()
   { return (CHTMLEditorDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_HTMLEDITORVIEW_H__6E150015_4EEC_4A12_AE5F_BB3A8D7E753D__INCLUDED_)
